from dao import sqluserdao
def add_user(data):
    user_id = sqluserdao.add_user(data)
    return user_id

def get_all_users(search_query=None):
    user_list = sqluserdao.get_all_users(search_query)
    return user_list
def get_problem_list(search_query=None):
    problem_list = sqluserdao.get_problem_list(search_query)
    return problem_list
def get_user_ratings(search_query=None):
    user_list = sqluserdao.get_user_ratings(search_query)
    return user_list

def insert_rating_sql(user_id, video_name, rating, train_time_sum,username,admission_no,phone):
    return sqluserdao.insert_rating_sql(user_id, video_name, rating, train_time_sum,username,admission_no,phone)
def insert_problem_sql(user_id, evaluate_text, video_name,username,admission_no):
    return sqluserdao.insert_problem_sql(user_id, evaluate_text, video_name,username,admission_no)

def get_user_detail(user_id):
    user, psychological_records = sqluserdao.get_user_detail(user_id)
    return user, psychological_records

def delete_user(user_id):
    if sqluserdao.delete_user(user_id):
        return True
    else:
        return False
def update_user(user_id, data):
    if sqluserdao.update_user(user_id, data):
        return True
    else:
        return False